<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>

    // Object.create(proto)  创建一个实例化对象,并指定实例化对象的原型[[Prototype]]指向

    var o1 = Object.create(Array.prototype);
    console.log(o1);

    var o2 = Object.create(null);
    console.log(o2);


    // 模拟封装
    // function myCreate(proto = null) {
    //     var obj = new Object();
    //     Object.setPrototypeOf(obj, proto);
    //     return obj;
    // }

    // var o1 = myCreate(Array.prototype);
    // console.log(o1);

    // var o1 = myCreate(null);
    // console.log(o1);




</script>

</html>